{extend name="base:base" /}
{block name="body"}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card layui-form">

                <div class="layui-card-body">
                    <a class="layui-btn layui-btn-normal openbox" href="<?php echo url('route_add'); ?>"><i class="layui-icon layui-icon-add-1"></i>添加 </a>
                    <a class="layui-btn layui-btn-normal ajax-get" onclick="javascript:;"  href="<?php echo url('route_reset'); ?>">
                        <i class="layui-icon layui-icon-refresh"></i>刷新
                    </a>
                </div>
                <div class="layui-card-body">
                    <table lay-even="" class="layui-table">
                        <thead>
                            <tr>
                                <th>原始URL</th>
                                <th>展示URL</th>
                                <th>类型</th>
                                <th>管理操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            foreach ($lists as $key => $value) {
                                ?>
                                <tr>
                                    <td> <?php echo $value['full_url'] ?>  </td>
                                    <td> <?php echo $value['url'] ?>  </td>
                                    <td> <?php echo $value['type'] ?>  </td>
                                    <td>                          
                                        <a class="layui-btn layui-btn-normal layui-btn-xs openbox" href="<?php echo url('route_edit', ['id' => $value['id']]) ?>"><i class="layui-icon layui-icon-edit"></i> 编辑</a>  

                                        <?php if ($value['type']) { ?>
                                            <a class="layui-btn layui-btn-xs ajax-get confirm layui-btn-danger" href="<?php echo url('route_delete', ['id' => $value['id']]) ?>"><i class="layui-icon layui-icon-delete"></i> 删除</a>        
                                        <?php } ?>
                                    </td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body">
                    <div class="page pull-right">
                        {$page}
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

{/block}
